<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        .box {
            width: 100px;
            height: 100px;
            background-color: pink;
        }
    </style>
</head>
<body>

<div class="box"></div>
<script>

    var box = document.getElementsByClassName("box")[0];

    box.onmouseover = function (event) {
        console.log("鼠标放到了box上");
        //阻止冒泡
        event = event || window.event;

        if(event && event.stopPropagation){
            event.stopPropagation();
        }else{
            event.cancelBubble = true;
        }
    }

    document.onmouseover = function (event) {

        console.log(event.bubbles);
        //谁触动事件，会被放进target中。
        console.log(event.target);

    }



</script>
</body>
</html>